package com.homework.dto;

import jakarta.validation.constraints.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
public class LoginDto {
    @NotNull(message = "用户ID不能为空")
    @Length(min = 6, max = 10, message = "用户ID长度必须在6-10之间")
    private String userId;

    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 10, message = "密码长度必须在6-10之间")
    private String password;

    @NotBlank(message = "角色不能为空")
    @Pattern(regexp = "^[0-2]$", message = "角色只能是学生、老师、管理员")
    private String role;
}
